import { userSearchReducer } from '@/components/userSearch/slice'
import { configureStore } from '@reduxjs/toolkit'
import {counterReducer} from '../components/counter/slice'

// 配置各个redux模块的redux, 产生store
const store = configureStore({
  reducer: { // 配置reducer
    counter: counterReducer,
    userSearch: userSearchReducer
  },
})

// 默认暴露store
export default store

// 暴露根state的类型
export type RootState = ReturnType<typeof store.getState>

// 暴露dispatch函数的类型
export type AppDispatch = typeof store.dispatch

